import request from '@/utils/requestH2'

/* 基础数据页面 */

/* 客户类型 */

// 客户类型列表查询
export function selCustomerTypeListApi(params) {
  return request({
    url: '/basicData/customerType/selCustomerTypeList',
    method: 'GET',
    params
  })
}

// 新增客户类型
export function addCustomerTypeApi(data) {
  return request({
    url: '/basicData/customerType/addCustomerType',
    method: 'POST',
    data
  })
}

// 编辑客户类型
// 导出一个函数，用于根据id更新客户类型
export function updateCustomerTypeByIdApi(data) {
  return request({
    url: `/basicData/customerType/updateCustomerTypeById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除客户类型
export function delCustomerTypeByIdsApi(data) {
  return request({
    url: '/basicData/customerType/delCustomerTypeByIds',
    method: 'DELETE',
    data
  })
}

/* 客户单位 */

// 客户单位列表查询
export function selCustomerUnitListApi(params) {
  return request({
    url: '/basicData/customerUnit/selCustomerUnitList',
    method: 'GET',
    params
  })
}

// 新增客户单位
export function addCustomerUnitApi(data) {
  return request({
    url: '/basicData/customerUnit/addCustomerUnit',
    method: 'POST',
    data
  })
}

// 编辑客户单位
export function updateCustomerUnitByIdApi(data) {
  return request({
    url: `/basicData/customerUnit/updateCustomerUnitById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除客户单位
export function delCustomerUnitByIdsApi(data) {
  return request({
    url: '/basicData/customerUnit/delCustomerUnitByIds',
    method: 'DELETE',
    data
  })
}

/* 事业部 */

// 事业部列表查询
export function selDepartmentListApi(params) {
  return request({
    url: '/basicData/department/selDepartmentList',
    method: 'GET',
    params
  })
}

// 新增事业部
export function addDepartmentApi(data) {
  return request({
    url: '/basicData/department/addDepartment',
    method: 'POST',
    data
  })
}

// 编辑事业部
export function updateDepartmentByIdApi(data) {
  return request({
    url: `/basicData/department/updateDepartmentById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除事业部
export function delDepartmentByIdsApi(data) {
  return request({
    url: '/basicData/department/delDepartmentByIds',
    method: 'DELETE',
    data
  })
}

/* 产品平台 */

// 产品平台列表查询
export function selPlatformListApi(params) {
  return request({
    url: '/basicData/platform/selPlatformList',
    method: 'GET',
    params
  })
}

// 新增产品平台
export function addPlatformApi(data) {
  return request({
    url: '/basicData/platform/addPlatform',
    method: 'POST',
    data
  })
}

// 编辑产品平台
export function updatePlatformByIdApi(data) {
  return request({
    url: `/basicData/platform/updatePlatformById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除产品平台
export function delPlatformByIdsApi(data) {
  return request({
    url: '/basicData/platform/delPlatformByIds',
    method: 'DELETE',
    data
  })
}

/* 项目领域 */

// 项目领域列表查询
export function selProjectAreaListApi(params) {
  return request({
    url: '/basicData/projectArea/selProjectAreaList',
    method: 'GET',
    params
  })
}

// 新增项目领域
export function addProjectAreaApi(data) {
  return request({
    url: '/basicData/projectArea/addProjectArea',
    method: 'POST',
    data
  })
}

// 编辑项目领域
export function updateProjectAreaByIdApi(data) {
  return request({
    url: `/basicData/projectArea/updateProjectAreaById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除项目领域
export function delProjectAreaByIdsApi(data) {
  return request({
    url: '/basicData/projectArea/delProjectAreaByIds',
    method: 'DELETE',
    data
  })
}

/* 项目类型 */

// 项目类型列表查询
export function selProjectTypeListApi(params) {
  return request({
    url: '/basicData/projectType/selProjectTypeList',
    method: 'GET',
    params
  })
}

// 新增项目类型
export function addProjectTypeApi(data) {
  return request({
    url: '/basicData/projectType/addProjectType',
    method: 'POST',
    data
  })
}

// 编辑项目类型
export function updateProjectTypeByIdApi(data) {
  return request({
    url: `/basicData/projectType/updateProjectTypeById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除项目类型
export function delProjectTypeByIdsApi(data) {
  return request({
    url: '/basicData/projectType/delProjectTypeByIds',
    method: 'DELETE',
    data
  })
}

/* 税率管理 */

// 税率管理列表查询
export function selTaxRateListApi(params) {
  return request({
    url: '/basicData/taxRate/selTaxRateList',
    method: 'GET',
    params
  })
}

// 新增税率管理
export function addTaxRateApi(data) {
  return request({
    url: '/basicData/taxRate/addTaxRate',
    method: 'POST',
    data
  })
}

// 编辑税率管理
export function updateTaxRateByIdApi(data) {
  return request({
    url: `/basicData/taxRate/updateTaxRateById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除税率管理
export function delTaxRateByIdsApi(data) {
  return request({
    url: '/basicData/taxRate/delTaxRateByIds',
    method: 'DELETE',
    data
  })
}

/* 项目采购方式 */

// 项目采购方式列表查询
export function selProjectFromListApi(params) {
  return request({
    url: '/basicData/projectFrom/selProjectFromList',
    method: 'GET',
    params
  })
}

// 新增项目采购方式
export function addProjectFromApi(data) {
  return request({
    url: '/basicData/projectFrom/addProjectFrom',
    method: 'POST',
    data
  })
}

// 修改项目采购方式
export function updateProjectFromByIdApi(data) {
  return request({
    url: `/basicData/projectFrom/updateProjectFromById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除项目采购方式
export function delProjectFromByIdsApi(data) {
  return request({
    url: '/basicData/projectFrom/delProjectFromByIds',
    method: 'DELETE',
    data
  })
}

/* 划转对象 */

// 划转对象列表查询
export function selTransferObjectListApi(params) {
  return request({
    url: '/basicData/transfer/selTransferObjectList',
    method: 'GET',
    params
  })
}

// 新增划转对象
export function addTransferObjectApi(data) {
  return request({
    url: '/basicData/transfer/addTransferObject',
    method: 'POST',
    data
  })
}

// 修改划转对象
export function updateTransferObjectByIdApi(data) {
  return request({
    url: `/basicData/transfer/updateTransferObjectById/${data.id}`,
    method: 'PUT',
    data: {
      name: data.name
    }
  })
}

// 根据ids删除划转对象
export function delTransferObjectByIdsApi(data) {
  return request({
    url: '/basicData/transfer/delTransferObjectByIds',
    method: 'DELETE',
    data
  })
}
